package service

import (
	"gitee.com/kinwyb/appTools/examples/src/assembly"
	"gitee.com/kinwyb/godb"
	"time"
)

// @rpcxService arithSev
type Arith struct{}

// Mul 线程
// @rpcxMethod
// @param query int a1* 值1
// @param query int b1 值2
// @return 返回内容
func (t *Arith) Mul(a1 int, b1 int) (int, error) {
	return a1 + b1, nil
}

// @rpcxMethod
func (t *Arith) PageTest(d int, pg *godb.PageObj, ctx assembly.Context) []int {
	pg.SetTotal(int64(d))
	return []int{1, 2, 3, 4}
}

// @rpcxMethod
func (t *Arith) PageTestNoResult(d int, pg *godb.PageObj, ctx assembly.Context) map[string]interface{} {
	pg.SetTotal(int64(d))
	return nil
}

// @rpcxMethod
// @param query string vcs* 参数描述
// @param header integer vv 参数描述
// @param body Arith _ 描述内容
func (t *Arith) TestContext(ctx assembly.Context) {
}

// @rpcxMethod
func ArithMulFun(a1 int, b1 int) int {
	return a1 + b1
}

// @rpcxMethod
func NoResult() {
	println("call fun NoResult")
}

// @rpcxMethod.go
func GoFunc() {
	time.Sleep(10 * time.Second)
	println("call fun GoFunc")
}

// @rpcxMethod
func PageTest(pg *godb.PageObj, ctx assembly.Context) {
	pg.SetTotal(20)
	//return []int{1, 2, 3, 4}
}
